﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.PassIdentifier
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>Represents an opaque identifier of a specific Pass in a Shader.</para>
  /// </summary>
  [NativeHeader("Runtime/Shaders/PassIdentifier.h")]
  [UsedByNativeCode]
  public readonly struct PassIdentifier : IEquatable<PassIdentifier>
  {
    internal readonly uint m_SubShaderIndex;
    internal readonly uint m_PassIndex;

    /// <summary>
    ///   <para>The index of the subshader within the shader (Read Only).</para>
    /// </summary>
    public uint SubshaderIndex => this.m_SubShaderIndex;

    /// <summary>
    ///   <para>The index of the pass within the subshader (Read Only).</para>
    /// </summary>
    public uint PassIndex => this.m_PassIndex;

    public override bool Equals(object o) => o is PassIdentifier rhs && this.Equals(rhs);

    public bool Equals(PassIdentifier rhs)
    {
      return (int) this.m_SubShaderIndex == (int) rhs.m_SubShaderIndex && (int) this.m_PassIndex == (int) rhs.m_PassIndex;
    }

    public static bool operator ==(PassIdentifier lhs, PassIdentifier rhs) => lhs.Equals(rhs);

    public static bool operator !=(PassIdentifier lhs, PassIdentifier rhs) => !(lhs == rhs);

    public override int GetHashCode()
    {
      uint num = this.m_SubShaderIndex;
      int hashCode1 = num.GetHashCode();
      num = this.m_PassIndex;
      int hashCode2 = num.GetHashCode();
      return hashCode1 ^ hashCode2;
    }
  }
}
